#!/bin/bash
# Zaitan Module - Ies4linux Install
# Zaitan Team <http://code.google.com/p/zaitan/>

RMOD_ENGINE='1.0'
RMOD_CATEGORY='Software'
RMOD_SUBCATEGORY='Net'
RMOD_NAME='Ies4linux'
RMOD_AUTHOR='Zaitan Team'
RMOD_VERSION='2.5beta6'
RMOD_DESCRIPTION='Installs Ies4linux'
RMOD_UPDATE_URL='http://code.google.com/p/zaitan/'

# install Ies4linux

echo Running $RMOD_NAME...
#/usr/lib/zaitan/modulo/mod-checkInstall


apt-get update

debs='wine cabextract'
for i in $debs; do
VERIFIQ=$(dpkg -s "$i" 2> /dev/null | grep "Status:" | awk '{ print $3 }')


	if [ "$VERIFIQ" != "ok" ]; then

	apt-get -y install $i
	sleep 1
	
	else
	echo "$i já está instalado"
	sleep 2
fi
done

cd /usr/share/zaitan

wget -c http://www.tatanka.com.br/ies4linux/downloads/ies4linux-2.5beta6.tar.gz
tar zxvf ies4linux-2.5beta6.tar.gz
cd ies4linux-*
./ies4linux

rm -rf ../../bin

cp /home/$USER/.ies4linux/bin/ie6 ../
mv ../ie6 /usr/local/bin


echo "[Desktop Entry]
Version=1.0
Exec=ie6
Icon=/home/$USER/.ies4linux/ies4linux.svg
Name=Internet Explorer 6.0
GenericName=Web Browser
Comment=MSIE 6.0 by IEs4Linux
Encoding=UTF-8
Terminal=false
Type=Application
Categories=Application;Network;" > /home/$USER/.local/share/applications/ies4linux-ie6.desktop


echo $RMOD_NAME Finibashed...

##Logs
echo $RMOD_NAME-$RMOD_VERSION | tee -a /usr/share/zaitan/logs
/usr/lib/zaitan/modulo/mod-logs
##

exit 0
